* ======================================================================= * 
* Title : Replication file for "Trauma and Stigma"
* Date : April 23, 2015 
* Author : Jean Hong & Woo Chang Kang 
* ======================================================================= * 


cd "/Users/Kang/Copy/my_publication/CMPS2015_dataverse"

log using "/Users/Kang/Copy/my_publication/CMPS2015_dataverse/Hong_Kang_CMPS2015.txt", text replace 

use "Hong_Kang_CMPS2015.dta", clear 

set matsize 11000 
tab year, gen(year)
global control "female unemployed married attend rank edu_comb"


* ---------------------------- * 
* Table 2 - Summary Statistics 
* ---------------------------- * 

# delimit 
qui xi: reg congovt prewar_05 violence vXw_pre05 $control  year1-year8 
	i.emd_code i.age, cl(emd_code);

sum conblu congovt conarmy conlegis conjudge conlgovt conbus concso contv 
	prewar_05 killed_MKW_GKW log_MG violence $control if e(sample) == 1 ;

sutex conblu congovt conarmy conlegis conjudge conlgovt conbus concso contv  
      prewar_05 killed_MKW_GKW log_MG violence $control
      if e(sample) == 1, minmax digits(3) labels ;
#delimit cr 


* ------------------------------------------------------------ * 
* Table 3 - Trauma Effects on Trust in Government and Society 
* ------------------------------------------------------------ * 
# delimit 
qui xi: reg congovt  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age, cl(emd_code) ; 
estimates store gov; 

qui xi: reg conblu   prewar_05 violence vXw_pre05  $control i.age year1-year8  
	i.emd_code, cl(emd_code);  
estimates store blu;                            
qui xi: reg conarmy prewar_05 violence vXw_pre05  $control  year1-year8  
	i.emd_code i.age, cl(emd_code);  
estimates store army;   

qui xi: reg conlegis  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age, cl(emd_code); 
estimates store leg;                       

# delimit 
esttab gov blu army leg ,  
	b(2) se(2) star(* .2 ** .1 *** .05) label scalars(N r2_a) 
	mtitles("Government" "Blue House" "Military" "Legislature") 
	keep(vXw_pre05 prewar_05 violence _cons) 
	order(vXw_pre05 violence prewar_05  _cons) 
	nonotes ; 

#delimit cr 
* ------------------------------------------------------------ * 
* Table 4 - Conditional Effects - Other Political Institution
* ------------------------------------------------------------ * 

# delimit
qui xi: reg conjudge  prewar_05 violence vXw_pre05  $control i.age year1-year8  
	i.emd_code, cl(emd_code);  
estimates store judge; 

qui xi: reg conlgovt prewar_05 violence vXw_pre05  $control  year1-year8  
	i.emd_code i.age, cl(emd_code);  
estimates store lgovt; 

qui xi: reg conbus  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age, cl(emd_code);  
estimates store bus; 

qui xi: reg concso prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age, cl(emd_code);  
estimates store cso; 

qui xi: reg contv  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age, cl(emd_code); 
estimates store tv; 

esttab judge lgovt bus cso tv ,
	b(2) se(2) star(* .2 ** .1 *** .05) label scalars(N r2_a) 
	title ("DID Estimates - War Cohorts")
	mtitles("Supreme Courts" "Local Government" "Business" "Civil Organization" "Media") 
	keep(vXw_pre05 prewar_05 violence _cons) 
	order(vXw_pre05 violence prewar_05  _cons) 
	nonotes;
#delimit cr 

* ------------------------------------------------------------ * 
* Table 5 - Conditional Effects - Who Killed Matter
* ------------------------------------------------------------ * 

gen new_vio_nk = 1 if log_gnk >= 3 & log_gnk != .
replace new_vio_nk = 0 if missing(new_vio_nk)
gen new_vio_nkXw_05 = new_vio_nk * prewar_05 

gen new_vio_sk = 1 if log_gsk >= 3 & log_gsk != .
replace new_vio_sk = 0 if missing(new_vio_sk)
gen new_vio_skXw_05 = new_vio_sk * prewar_05 

gen new_vio_us = 1 if log_gus >= 3 & log_gus != .
replace new_vio_us = 0 if missing(new_vio_us)
gen new_vio_usXw_05 = new_vio_us * prewar_05 


# delimit ;
qui xi: reg congovt  prewar_05 new_vio_us new_vio_usXw_05  $control year1-year8   
	i.emd_code i.age, cl(emd_code) ; 
estimates store us; 


qui xi: reg congovt  prewar_05 new_vio_sk new_vio_skXw_05  $control year1-year8   
	i.emd_code i.age, cl(emd_code) ; 
estimates store sk; 

qui xi: reg congovt  prewar_05 new_vio_nk new_vio_nkXw_05  $control year1-year8   
	i.emd_code i.age, cl(emd_code) ; 
estimates store nk; 

esttab  us nk sk,  
	b(2) se(2) star(* .2 ** .1 *** .05) label scalars(N r2_a)  
	mtitles("Untied States" "North Korea" "South Korea")
	keep(new_vio_usXw_05 new_vio_skXw_05 new_vio_nkXw_05 
	     new_vio_nk new_vio_sk new_vio_us prewar_05 _cons) 
	order(new_vio_usXw_05 new_vio_skXw_05 new_vio_nkXw_05 
	     new_vio_nk new_vio_sk new_vio_us prewar_05 _cons) 
	nonotes ;
# delimit cr


* =========================================================== * 
* Appendix Table A - Summary Statistics for Pre-war Cohort
* =========================================================== * 

# delimit 
qui xi: reg congovt prewar_05 violence vXw_pre05 $control  year1-year8 
	i.emd_code i.age, cl(emd_code);

sutex conblu congovt conarmy conlegis conjudge conlgovt conbus concso contv  
	prewar_05 killed_MKW_GKW log_MG violence $control
	if e(sample) == 1 & prewar_05 == 1 , minmax digits(3) labels ;
#delimit cr 

* =========================================================== * 
* Appendix Table B - Summary Statistics for Post-war Cohort
* =========================================================== * 

# delimit 
qui xi: reg congovt prewar_05 violence vXw_pre05 $control  year1-year8 
	i.emd_code i.age, cl(emd_code);


sutex conblu congovt conarmy conlegis conjudge conlgovt conbus concso contv  
	prewar_05 killed_MKW_GKW log_MG violence $control
	if e(sample) == 1 & prewar_05 == 0 , minmax digits(3) labels ;
#delimit cr 


* =========================================================== * 
* Appendix Table C - Robustness Check - Varying Extent of Violence
* =========================================================== * 

capture program drop v_diff 
program define v_diff 
capture drop new_vio nvXw_05
gen new_vio = 1 if log_MG >= `1' & log_MG != .
replace new_vio = 0 if missing(new_vio)
gen nvXw_05 = new_vio * prewar_05 

label var new_vio "Violence"
label var nvXw_05 "Violence X Pre War (-5)"
global control "female unemployed married attend rank edu_comb"

# delimit ; 
qui xi: reg congovt  prewar_05 new_vio nvXw_05 $control  year1-year8   
	i.emd_code i.age, cl(emd_code); 
# delimit cr  
estimates store gov_`2' 
end 

v_diff 0 0
v_diff 2.3  10 // 10 deaths 
v_diff 4.61 100 // 100 deaths 

gen vio_con = . 
replace vio_con = 1 if log_MG> 0 & log_MG < 3 
replace vio_con = 2 if log_MG >= 3 & log_MG < 5 
replace vio_con = 3 if log_MG >= 5 & log_MG != .  
replace vio_con = 0 if missing(vio_con)
tab vio_con 

gen vconXpre05 = vio_con * prewar_05 

# delimit ; 
qui xi: reg congovt  prewar_05 vio_con vconXpre05  $control year1-year8 
	i.emd_code i.age, cl(emd_code) ; 
estimates store vcon ; 
# delimit cr 

# delimit ; 
esttab gov_0 gov_10 gov_100 vcon ,  
	b(2) se(2) star(* .2 ** .1 *** .05) label scalars(N r2_a) 
	mtitles("Death > 0" "Death > 10" "Death > 100" "Ordered Death") 
	keep(nvXw_05 prewar_05 new_vio vio_con vconXpre05 _cons) 
	order(nvXw_05 new_vio vio_con vconXpre05 prewar_05  _cons) 
	nonotes ; 
# delimit cr

* =========================================================== * 
* Appendix Table D - 10 Year Window for Pre- and Post- War cohort 
* =========================================================== * 

gen prewar_10 = . 
replace prewar_10 = 0 if birth_from_end_war > 0 & birth_from_end_war < 11 
replace prewar_10 = 1 if birth_from_end_war <= 0 & birth_from_end_war > -10

gen vXw_10 = violence * prewar_10 

label var vXw_10 "Violence X Pre War (-10)"
label var prewar_10 "Pre War (-10)"

# delimit ; 
qui xi: reg conblu prewar_10 violence vXw_10 $control year1-year8   
	i.emd_code i.age, cl(emd_code);  
estimates store blu10 ;                              
qui xi: reg congovt prewar_10 violence vXw_10  $control year1-year8
	i.emd_code i.age, cl(emd_code);  
estimates store govt10 ;                             
qui xi: reg conarmy prewar_10 violence vXw_10 $control  year1-year8
	i.emd_code i.age, cl(emd_code);  
estimates store army10 ;    
qui xi: reg conlegis  prewar_10 violence vXw_10  $control year1-year8
	i.emd_code i.age, cl(emd_code);  
estimates store leg10 ;                      
# delimit cr

# delimit ; 
esttab govt10 blu10 army10 leg10,    
	b(2) se(2) star(* .2 ** .1 *** .05) label scalars(N r2_a) 
	mtitles("Government" "Blue House" "Military" "Legislature") 
	keep(vXw_10 prewar_10 violence _cons) 
	order(vXw_10 violence prewar_10  _cons) 
	nonotes
; 
# delimit cr



* =========================================================== * 
* Appendix Table F - Analysis of Subset by Province 
* =========================================================== * 

# delimit ; 
qui xi: reg congovt  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age if province_code  !="11" , cl(emd_code);  
estimates store seoul;  

qui xi: reg congovt  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age if province_code  !="31" , cl(emd_code);  
estimates store kk;  

qui xi: reg congovt  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age if province_code  !="34" , cl(emd_code);  
estimates store cn;  

qui xi: reg congovt  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age if province_code  !="38" , cl(emd_code);  
estimates store kn;  

qui xi: reg congovt  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age if province_code  !="36" , cl(emd_code);  
estimates store jn;  
# delimit cr


# delimit ; 
esttab seoul kk cn kn jn ,
	b(2) se(2) star(* .2 ** .1 *** .05) label scalars(N r2_a) 
	mtitles("No Seoul" "No Kyungkido" "No Choong" "Legislature" "Society") 
	title ("Trauma effects on trust in government and society")
	keep(vXw_pre05 prewar_05 violence _cons) 
	order(vXw_pre05 violence prewar_05 _cons) ;
# delimit cr


* =========================================================== * 
* Appendix Table G - Sigungu Clustered Standard Error
* =========================================================== * 

# delimit ; 
qui xi: reg congovt  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age, cl(sigungu_code);  
estimates store gov_sgg;  
qui xi: reg conblu   prewar_05 violence vXw_pre05  $control i.age year1-year8  
	i.emd_code, cl(sigungu_code);  
estimates store blu_sgg;                             
qui xi: reg conarmy prewar_05 violence vXw_pre05  $control i.age year1-year8
	i.emd_code , cl(sigungu_code);  
estimates store army_sgg;   
qui xi: reg conlegis  prewar_05 violence vXw_pre05  $control year1-year8   
	i.emd_code i.age, cl(sigungu_code);  
estimates store leg_sgg; 
# delimit cr                        

# delimit ; 
esttab gov_sgg blu_sgg army_sgg leg_sgg ,  
	b(2) se(2) star(* .2 ** .1 *** .05) label scalars(N r2_a) 
	mtitles("Government" "Blue House" "Military" "Legislature") 
	keep(vXw_pre05 prewar_05 violence _cons) 
	order(vXw_pre05 prewar_05 violence _cons) 
	nonotes ; 
# delimit cr



* =========================================================== * 
* Appendix Table H - Placebo Test 1, Cohort before and after 1945 
* =========================================================== * 

* placebo_pre  : 1940 41, 42, 43, 44 VS 45 46 47 48 49)

gen placebo_pre = . 
replace placebo_pre = 0 if birth_from_end_war > -9 & birth_from_end_war < -3
replace placebo_pre = 1 if birth_from_end_war > -14 & birth_from_end_war < -8

gen plpreXw_05 = placebo_pre * violence 

# delimit ; 
qui xi: reg conblu   plpreXw_05 violence placebo_pre  $control year1-year8  
	i.emd_code i.age, cl(emd_code);  
estimates store blu_pre;                             
qui xi: reg congovt  plpreXw_05 violence placebo_pre  $control year1-year8   
	i.emd_code i.age, cl(emd_code);  
estimates store gov_pre;  
qui xi: reg conarmy  plpreXw_05 violence placebo_pre  $control  year1-year8  
	i.emd_code i.age, cl(emd_code);  
estimates store army_pre;                             
qui xi: reg conlegis plpreXw_05 violence placebo_pre  $control year1-year8   
	i.emd_code i.age, cl(emd_code);  
estimates store leg_pre; 
# delimit cr  


# delimit ; 
esttab gov_pre blu_pre army_pre leg_pre ,  
	b(2) se(2) star(* .2 ** .1 *** .05) label scalars(N r2_a) 
	mtitles("Government" "Blue House" "Military" "Legislature") 
	keep(plpreXw_05 violence placebo_pre _cons) 
	order(plpreXw_05 violence placebo_pre _cons) 
	nonotes ; 
# delimit cr



* =========================================================== * 
* Appendix Table I - Placebo Test 2, Cohort before and after 1958
* =========================================================== * 

* placebo_post : 1954 55, 56, 57, 58 VS 59 60 61 62 63)
gen placebo_post = . 
replace placebo_post = 0 if birth_from_end_war > 5 & birth_from_end_war < 11
replace placebo_post = 1 if birth_from_end_war > 0 & birth_from_end_war < 6

gen plpostXw_05 = placebo_post * violence 

# delimit ; 
qui xi: reg conblu   plpostXw_05 violence placebo_post $control year1-year8  
	i.emd_code i.age, cl(emd_code);  
estimates store blu_post;                             
qui xi: reg congovt  plpostXw_05 violence placebo_post $control year1-year8   
	i.emd_code i.age, cl(emd_code);  
estimates store gov_post;  
qui xi: reg conarmy  plpostXw_05 violence placebo_post $control  year1-year8  
	i.emd_code i.age, cl(emd_code);  
estimates store army_post;                              
qui xi: reg conlegis plpostXw_05 violence placebo_post $control year1-year8   
	i.emd_code i.age, cl(emd_code);  
estimates store leg_post;   
# delimit cr 


# delimit ; 
esttab gov_post blu_post army_post leg_post , 
	b(2) se(2) star(* .2 ** .1 *** .05) label scalars(N r2_a) 
	mtitles("Government" "Blue House" "Military" "Legislature") 
	keep(plpostXw_05 placebo_post violence _cons) 
	order(plpostXw_05 violence placebo_post  _cons) 
	nonotes ; 
# delimit cr

log close







